// $ANTLR 3.4 C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g 2012-05-09 18:51:26

	package data.grammar;
	
	import data.*;
	import stream.DebugStream;
	import java.util.Stack;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

@SuppressWarnings({"all", "warnings", "unchecked"})
public class LocDataParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "COMMENT", "ENDLINE", "INT", "TAB", "WS", "'+'", "','"
    };

    public static final int EOF=-1;
    public static final int T__9=9;
    public static final int T__10=10;
    public static final int COMMENT=4;
    public static final int ENDLINE=5;
    public static final int INT=6;
    public static final int TAB=7;
    public static final int WS=8;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public LocDataParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public LocDataParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

    public String[] getTokenNames() { return LocDataParser.tokenNames; }
    public String getGrammarFileName() { return "C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g"; }


    	private DebugStream db;
    	private Group group;
    	
    	private Stack<String> errorContextStack;
    	
    	public LocDataParser(TokenStream in, DebugStream db, Group group) {
    		this(in);
    		this.db = db;
    		this.group = group;
    		this.errorContextStack = new Stack<String>();
    	}
    	
    	@Override
    	public String getErrorMessage(RecognitionException e, String[] tokenNames) {
    		if (errorContextStack.isEmpty()) {
    			return super.getErrorMessage(e, tokenNames) + " (" + group + ")";
    		}
    		return super.getErrorMessage(e, tokenNames) + " in " + errorContextStack.peek() + " (" + group + ")";
    	}



    // $ANTLR start "start"
    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:50:1: start : ( slide ( ENDLINE slide )* )? ( ENDLINE )? EOF ;
    public final void start() throws RecognitionException {
        try {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:51:2: ( ( slide ( ENDLINE slide )* )? ( ENDLINE )? EOF )
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:51:4: ( slide ( ENDLINE slide )* )? ( ENDLINE )? EOF
            {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:51:4: ( slide ( ENDLINE slide )* )?
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==INT) ) {
                alt2=1;
            }
            switch (alt2) {
                case 1 :
                    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:51:5: slide ( ENDLINE slide )*
                    {
                    pushFollow(FOLLOW_slide_in_start125);
                    slide();

                    state._fsp--;


                    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:51:11: ( ENDLINE slide )*
                    loop1:
                    do {
                        int alt1=2;
                        int LA1_0 = input.LA(1);

                        if ( (LA1_0==ENDLINE) ) {
                            int LA1_1 = input.LA(2);

                            if ( (LA1_1==INT) ) {
                                alt1=1;
                            }


                        }


                        switch (alt1) {
                    	case 1 :
                    	    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:51:12: ENDLINE slide
                    	    {
                    	    match(input,ENDLINE,FOLLOW_ENDLINE_in_start128); 

                    	    pushFollow(FOLLOW_slide_in_start130);
                    	    slide();

                    	    state._fsp--;


                    	    }
                    	    break;

                    	default :
                    	    break loop1;
                        }
                    } while (true);


                    }
                    break;

            }


            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:52:3: ( ENDLINE )?
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( (LA3_0==ENDLINE) ) {
                alt3=1;
            }
            switch (alt3) {
                case 1 :
                    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:52:3: ENDLINE
                    {
                    match(input,ENDLINE,FOLLOW_ENDLINE_in_start138); 

                    }
                    break;

            }


            match(input,EOF,FOLLOW_EOF_in_start141); 

            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "start"


    protected static class slide_scope {
        Slide curSlide;
    }
    protected Stack slide_stack = new Stack();



    // $ANTLR start "slide"
    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:55:1: slide : INT ( data )? ;
    public final void slide() throws RecognitionException {
        slide_stack.push(new slide_scope());
        Token INT1=null;

         errorContextStack.push("slide definition"); 
        try {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:59:2: ( INT ( data )? )
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:59:4: INT ( data )?
            {
            INT1=(Token)match(input,INT,FOLLOW_INT_in_slide165); 

            	((slide_scope)slide_stack.peek()).curSlide = new Slide(Integer.parseInt(INT1.getText())); 
            			group.addSlide(((slide_scope)slide_stack.peek()).curSlide);
            		

            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:63:3: ( data )?
            int alt4=2;
            int LA4_0 = input.LA(1);

            if ( (LA4_0==TAB) ) {
                alt4=1;
            }
            switch (alt4) {
                case 1 :
                    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:63:3: data
                    {
                    pushFollow(FOLLOW_data_in_slide175);
                    data();

                    state._fsp--;


                    }
                    break;

            }


            }

             errorContextStack.pop(); 
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
            slide_stack.pop();
        }
        return ;
    }
    // $ANTLR end "slide"



    // $ANTLR start "data"
    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:66:1: data : TAB cell ( ENDLINE TAB cell )* ;
    public final void data() throws RecognitionException {
        try {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:66:5: ( TAB cell ( ENDLINE TAB cell )* )
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:66:7: TAB cell ( ENDLINE TAB cell )*
            {
            match(input,TAB,FOLLOW_TAB_in_data186); 

            pushFollow(FOLLOW_cell_in_data188);
            cell();

            state._fsp--;


            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:66:16: ( ENDLINE TAB cell )*
            loop5:
            do {
                int alt5=2;
                int LA5_0 = input.LA(1);

                if ( (LA5_0==ENDLINE) ) {
                    int LA5_1 = input.LA(2);

                    if ( (LA5_1==TAB) ) {
                        alt5=1;
                    }


                }


                switch (alt5) {
            	case 1 :
            	    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:66:17: ENDLINE TAB cell
            	    {
            	    match(input,ENDLINE,FOLLOW_ENDLINE_in_data191); 

            	    match(input,TAB,FOLLOW_TAB_in_data193); 

            	    pushFollow(FOLLOW_cell_in_data195);
            	    cell();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop5;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "data"


    protected static class cell_scope {
        Cell curCell;
    }
    protected Stack cell_stack = new Stack();



    // $ANTLR start "cell"
    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:69:1: cell : ( cyto )? TAB ( mem )? ;
    public final void cell() throws RecognitionException {
        cell_stack.push(new cell_scope());

        	((cell_scope)cell_stack.peek()).curCell = new Cell(((slide_scope)slide_stack.peek()).curSlide);
        	((slide_scope)slide_stack.peek()).curSlide.addCell(((cell_scope)cell_stack.peek()).curCell);
        	
        	errorContextStack.push("cell definition");

        try {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:78:2: ( ( cyto )? TAB ( mem )? )
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:78:4: ( cyto )? TAB ( mem )?
            {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:78:4: ( cyto )?
            int alt6=2;
            int LA6_0 = input.LA(1);

            if ( (LA6_0==INT) ) {
                alt6=1;
            }
            switch (alt6) {
                case 1 :
                    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:78:4: cyto
                    {
                    pushFollow(FOLLOW_cyto_in_cell221);
                    cyto();

                    state._fsp--;


                    }
                    break;

            }


            match(input,TAB,FOLLOW_TAB_in_cell224); 

            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:78:14: ( mem )?
            int alt7=2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0==INT) ) {
                alt7=1;
            }
            switch (alt7) {
                case 1 :
                    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:78:14: mem
                    {
                    pushFollow(FOLLOW_mem_in_cell226);
                    mem();

                    state._fsp--;


                    }
                    break;

            }


            }

             errorContextStack.pop(); 
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
            cell_stack.pop();
        }
        return ;
    }
    // $ANTLR end "cell"



    // $ANTLR start "cyto"
    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:81:1: cyto : cytoCluster ( ( '+' | ',' ) cytoCluster )* ;
    public final void cyto() throws RecognitionException {
        try {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:81:5: ( cytoCluster ( ( '+' | ',' ) cytoCluster )* )
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:81:7: cytoCluster ( ( '+' | ',' ) cytoCluster )*
            {
            pushFollow(FOLLOW_cytoCluster_in_cyto237);
            cytoCluster();

            state._fsp--;


            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:81:19: ( ( '+' | ',' ) cytoCluster )*
            loop8:
            do {
                int alt8=2;
                int LA8_0 = input.LA(1);

                if ( ((LA8_0 >= 9 && LA8_0 <= 10)) ) {
                    alt8=1;
                }


                switch (alt8) {
            	case 1 :
            	    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:81:20: ( '+' | ',' ) cytoCluster
            	    {
            	    if ( (input.LA(1) >= 9 && input.LA(1) <= 10) ) {
            	        input.consume();
            	        state.errorRecovery=false;
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        throw mse;
            	    }


            	    pushFollow(FOLLOW_cytoCluster_in_cyto246);
            	    cytoCluster();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop8;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "cyto"



    // $ANTLR start "mem"
    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:84:1: mem : memCluster ( ( '+' | ',' ) memCluster )* ;
    public final void mem() throws RecognitionException {
        try {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:84:5: ( memCluster ( ( '+' | ',' ) memCluster )* )
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:84:7: memCluster ( ( '+' | ',' ) memCluster )*
            {
            pushFollow(FOLLOW_memCluster_in_mem259);
            memCluster();

            state._fsp--;


            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:84:18: ( ( '+' | ',' ) memCluster )*
            loop9:
            do {
                int alt9=2;
                int LA9_0 = input.LA(1);

                if ( ((LA9_0 >= 9 && LA9_0 <= 10)) ) {
                    alt9=1;
                }


                switch (alt9) {
            	case 1 :
            	    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:84:19: ( '+' | ',' ) memCluster
            	    {
            	    if ( (input.LA(1) >= 9 && input.LA(1) <= 10) ) {
            	        input.consume();
            	        state.errorRecovery=false;
            	    }
            	    else {
            	        MismatchedSetException mse = new MismatchedSetException(null,input);
            	        throw mse;
            	    }


            	    pushFollow(FOLLOW_memCluster_in_mem268);
            	    memCluster();

            	    state._fsp--;


            	    }
            	    break;

            	default :
            	    break loop9;
                }
            } while (true);


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "mem"



    // $ANTLR start "cytoCluster"
    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:87:1: cytoCluster : INT ;
    public final void cytoCluster() throws RecognitionException {
        Token INT2=null;

         errorContextStack.push("cytoplasmic cluster data"); 
        try {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:90:2: ( INT )
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:90:4: INT
            {
            INT2=(Token)match(input,INT,FOLLOW_INT_in_cytoCluster292); 


            			Cluster cluster = new Cluster(((cell_scope)cell_stack.peek()).curCell, Integer.parseInt(INT2.getText()), false);
            			((cell_scope)cell_stack.peek()).curCell.addCluster(cluster);
            		

            }

             errorContextStack.pop(); 
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "cytoCluster"



    // $ANTLR start "memCluster"
    // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:97:1: memCluster : INT ;
    public final void memCluster() throws RecognitionException {
        Token INT3=null;

         errorContextStack.push("membrane cluster data"); 
        try {
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:100:2: ( INT )
            // C:\\Users\\Charles\\Documents\\ANTLR\\lant\\LocData.g:100:4: INT
            {
            INT3=(Token)match(input,INT,FOLLOW_INT_in_memCluster318); 


            			Cluster cluster = new Cluster(((cell_scope)cell_stack.peek()).curCell, Integer.parseInt(INT3.getText()), true);
            			((cell_scope)cell_stack.peek()).curCell.addCluster(cluster);
            		

            }

             errorContextStack.pop(); 
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }

        finally {
        	// do for sure before leaving
        }
        return ;
    }
    // $ANTLR end "memCluster"

    // Delegated rules


 

    public static final BitSet FOLLOW_slide_in_start125 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_ENDLINE_in_start128 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_slide_in_start130 = new BitSet(new long[]{0x0000000000000020L});
    public static final BitSet FOLLOW_ENDLINE_in_start138 = new BitSet(new long[]{0x0000000000000000L});
    public static final BitSet FOLLOW_EOF_in_start141 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_in_slide165 = new BitSet(new long[]{0x0000000000000082L});
    public static final BitSet FOLLOW_data_in_slide175 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_TAB_in_data186 = new BitSet(new long[]{0x00000000000000C0L});
    public static final BitSet FOLLOW_cell_in_data188 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_ENDLINE_in_data191 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_TAB_in_data193 = new BitSet(new long[]{0x00000000000000C0L});
    public static final BitSet FOLLOW_cell_in_data195 = new BitSet(new long[]{0x0000000000000022L});
    public static final BitSet FOLLOW_cyto_in_cell221 = new BitSet(new long[]{0x0000000000000080L});
    public static final BitSet FOLLOW_TAB_in_cell224 = new BitSet(new long[]{0x0000000000000042L});
    public static final BitSet FOLLOW_mem_in_cell226 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_cytoCluster_in_cyto237 = new BitSet(new long[]{0x0000000000000602L});
    public static final BitSet FOLLOW_set_in_cyto240 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_cytoCluster_in_cyto246 = new BitSet(new long[]{0x0000000000000602L});
    public static final BitSet FOLLOW_memCluster_in_mem259 = new BitSet(new long[]{0x0000000000000602L});
    public static final BitSet FOLLOW_set_in_mem262 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_memCluster_in_mem268 = new BitSet(new long[]{0x0000000000000602L});
    public static final BitSet FOLLOW_INT_in_cytoCluster292 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_INT_in_memCluster318 = new BitSet(new long[]{0x0000000000000002L});

}